package optimizers.simplega.oscillator.faststrong;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.concurrent.CompletionService;
import java.util.concurrent.ExecutorCompletionService;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import optimizers.commons.RunConfig;
import optimizers.ganeat.sin.GASin;
import optimizers.ganeat.sin.IndividualSin;
import optimizers.simplega.Constants;
import optimizers.simplega.Individual;
import runconfiguration.FSOConfiguration;
import visualization.GraphDisplayer;

public class Test {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		RunConfig config = new FSOConfiguration();
		IndividualFSO individualFSO = new IndividualFSO(4, config);
		individualFSO.evaluateFitness();
		GraphDisplayer displayer = new GraphDisplayer("");
		displayer.addGraph(
				individualFSO.getOligoModel().getVisualization(250, 250),
				individualFSO.displayTimeSereis(),
				individualFSO.printModelInTextArea());
		displayer.display();
		ExecutorService eservice;
		CompletionService<Object> cservice;
		eservice = Executors.newFixedThreadPool(Constants.nParallelThreads);
		cservice = new ExecutorCompletionService<Object>(eservice);
		individualFSO.prune(cservice);
		displayer.addGraph(
				individualFSO.getOligoModel().getVisualization(250, 250),
				individualFSO.displayTimeSereis(),
				individualFSO.printModelInTextArea());
		displayer.display();
	}
}
